const { Controller } = require("egg");
class NewsController extends Controller {
  async index() {
    const { ctx, service } = this;
    // 获取get传值
    let { pageNum = 1, pageSize = this.config.news.pageSize } = ctx.query;
    // 调用service
    const list = await service.news.list(pageNum, pageSize);
    await ctx.render("index", { list });
  }
}
module.exports = NewsController;
